package cayte.xiami.in.ui;

import android.app.Activity;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import cayte.xiami.in.R;

public class TitleView {
	private Activity act;

	public TextView text;
	public ImageView left, right;

	public TitleView(Activity act) {
		this.act = act;
		initView();
	}

	private void initView() {
		text = (TextView) act.findViewById(R.id.titleText);
		left = (ImageView) act.findViewById(R.id.titleLeft);
		right = (ImageView) act.findViewById(R.id.titleRight);
	}

	public void setText(int text) {
		this.text.setText(text);
	}

	public void setText(String text) {
		this.text.setText(text);
	}

	public void setLeftImage(int image, OnClickListener listener) {
		left.setImageResource(image);
		left.setOnClickListener(listener);
	}

	public void setRightImage(int image, OnClickListener listener) {
		right.setImageResource(image);
		right.setOnClickListener(listener);
	}

}
